package com.gzpi.hwgggh.timedtask;

import com.gzpi.hwgggh.utils.FileUtil;
import com.gzpi.hwgggh.utils.HwggConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.io.File;

/**
 * @date : 2021-02-23 17:14
 **/
@Component
public class DeleteFileTask {

    /**
     * 每天0秒59分23点清理垃圾文件
     */
    @Scheduled(cron = "0 59 23 * * ? ")
    public void deleteFile(){
        FileUtil.deleteFiles(HwggConstants.SAVE_PATH+"ExportFile"+ File.separator);
    }


}
